package cn.njxzc.examples;

import java.util.ArrayList;
import java.util.Iterator;

public class Exam8_16 {
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public static void main(String[] args) {
		ArrayList list = new ArrayList();
		list.add("to");
		list.add("be");
		list.add("or");
		list.add("not");
		list.add("to");
		list.add("be");
		System.out.println(list);
		Iterator i = list.iterator();
		String s;
		while (i.hasNext()) {
			s = (String) i.next();
			if (s.equals("not"))
				i.remove();
		}
		System.out.println(list);
	}
}
